package com.wlyy.his.controller.user.pc;

import com.wlyy.his.bean.user.pc.dto.MrdFindDto;
import com.wlyy.his.common.api.CommonResult;
import com.wlyy.his.service.pc.IMedicalRecodeNumberService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  medicalRecodeNumber前端控制器  RestController注解 将结果以JSON形式返回
 * </p>
 *
 * @author zyh
 * @since 2021-09-02
 */
@RestController
@RequestMapping("/medicalRecodeNumberd")
public class MedicalRecodeNumberController {
    @Resource
    public IMedicalRecodeNumberService medicalRecodeNumberService;

    /**
     * 保存修改公用 POST请求方式
     * @param mrdFindDto 保存的对象
     * @return CommonResult
     */
    @PostMapping("/BindMrd")
    public CommonResult bindMrd(@RequestBody MrdFindDto mrdFindDto) {
        String mrd = medicalRecodeNumberService.bindMrd(mrdFindDto);
        return CommonResult.success(mrd);
    }

    /**
     * 查询一个
     * @param mrdFindDto 查找对象的主键ID
     * @return CommonResult
     */
    @PostMapping("/findOne")
    public CommonResult findOne(@RequestBody MrdFindDto mrdFindDto) {
        String mrd = medicalRecodeNumberService.getMRD(mrdFindDto);
        return CommonResult.success(mrd);
    }


}

